<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<table  id="feaReport_upload1" cellpadding="0" class="t_css table01" width="100%" border="0" cellpadding="0">
	<tr>
	    <td class="t_bar2" width="40%"><span class="color_red">*</span>表1：贷款情况明细表（单位：万元）&nbsp;&nbsp;<a href="#" onclick="return ContentDownDesc('贷款情况明细表.doc');" class="link_x">
				<img alt="" src="${res}/images/ico_word.gif">贷款情况明细表</a>&nbsp;&nbsp;</td>
		<td  class="t_bar2" >
			<input type="file" name="filedata" />
			<input type="hidden" id="uploadTypeKeyContent" value="proposal_content," /> 
			<input type="hidden" id="file_code" name="proposal/file_code" class="required" value="<x:out select="$xmlData/data/proposal/file_code" />" />
		</td>
		<c:set var="file_code"><x:out select="$xmlData/data/proposal/file_code" /></c:set>
		<td class="t_bar2" id="uploadsuccess" <c:if test="${file_code==''}" >style="display:none" </c:if>>
				<input type="hidden" id="fileNameHid1" value="<x:out select="$xmlData/data/proposal/file_name" />"/>
				您已经上传附件：<a id="proposal_downLoadFile" href="${ctx}/file/ajax-filedownload?fileCode=<x:out select="$xmlData/data/proposal/file_code" />" class="link_x" ><span name="proposal/file_name" id="file_name"><x:out select="$xmlData/data/proposal/file_name" /></span></a>&nbsp;&nbsp;(上传时间<span name="proposal/file_date" id="file_date"><x:out select="$xmlData/data/proposal/file_date" /></span>) <a href="###" class="link_x" onclick="delContent('feaReport_upload1')">删除</a>
		</td>
	</tr>
	
</table>
<table cellpadding="0" class="t_css" width="100%" border="0" cellpadding="0"  id="budgetsMsg">
<tr>
<td align="right" width="20%">贷款单位名称（公章）：</td>
<td width="30%"><input  name="budgets/loan_org_name" id="loan_org_name" label="贷款情况明细表-->贷款单位名称" type="text"  class="input_css  required"   maxlength="50" value="<x:out select="$xmlData/data/budgets/loan_org_name" />"/> </td>
<td align="right" width="20%">银行账号：</td>
<td width="30%"><input  name="budgets/bank_account" id="bank_account" label="贷款情况明细表-->银行账号" type="text"  class="input_css  required"   maxlength="50" value="<x:out select="$xmlData/data/budgets/bank_account" />"/> </td>
</tr>
<tr>
<td align="right" >贷款银行联系人：</td>
<td><input  name="budgets/loan_bank_contacts_psn" id="loan_bank_contacts_psn" label="贷款情况明细表-->贷款银行联系人" type="text"  class="input_css  required"   maxlength="50" value="<x:out select="$xmlData/data/budgets/loan_bank_contacts_psn" />"/> </td>
<td align="right" >联系电话：</td>
<td><input  name="budgets/loan_bank_contacts_tel" id="loan_bank_contacts_tel" label="贷款情况明细表-->联系电话" type="text"  class="input_css  required"   maxlength="50" value="<x:out select="$xmlData/data/budgets/loan_bank_contacts_tel" />"/> </td>
</tr>
</table>
<table id="tblDetailed" cellpadding="0" class="t_css" width="100%"
	border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
	<thead>
		<tr style="border: 1px solid #B7D1E6">
			<th class="TblHead" align="center" width="4%">选择</th>
			<th class="TblHead" align="center" width="4%">序号</th>
			<th class="TblHead" align="center" width="8%">贷款额度</th>
			<th class="TblHead" align="center" width="9.5%">贷款合同号</th>
			<th class="TblHead" align="center" width="12%">贷款日期</th>
			<th class="TblHead" align="center" width="10%">贷款用途</th>
			<th class="TblHead" align="center" width="7.5%">贷款期限</th>
			<th class="TblHead" align="center" width="7.5%">贷款利率(%)</th>
			<th class="TblHead" align="center" width="7.5%">同期银行基准利率(%)</th>
			<th class="TblHead" align="center" width="7.5%">已还贷款本金</th>
			<th class="TblHead" align="center" width="7.5%">应付利息</th>
			<th class="TblHead" align="center" width="7.5%">实际已付利息</th>
			<th class="TblHead" align="center" width="7.5%">按照同期基准利率应付利息</th>
		</tr>
	</thead>
	<tbody id="tab">
		<tr style="display: none">
			<td align="center"><input type="radio" class="radiobutton"
				name="selDetailed"></td>
			<td align="center"><span name="detaileds|detailed[0]@seq_no">[index]</span>
			</td>
			<td style="text-align: center;"><input type="text" onchange="setTotalDetailed()"
				name="detaileds|detailed[0]|loan_limit" onfocus="InitInput.setNumber(this,9,4,2)" style="width: 80%;text-align: right;"
				class="input_text required" label="贷款额度" value="" />
			</td>
			<td style="text-align: center;"><input type="text"
				name="detaileds|detailed[0]|loan_ctr_no" style="width: 80%"
				class="input_text required" maxlength=50 label="贷款合同号" value="" /></td>
			<td align="center" ><input id="loan_date_[0]"
				name="detaileds|detailed[0]|loan_date" label="贷款日期" value=""
				class=" required input_text date " style="width: 70px" /></td>
			<td style="text-align: center;"><input type="text"
				name="detaileds|detailed[0]|loan_use" style="width: 80%"
				class="input_text required" maxlength=50 label="贷款用途" value="" />
			</td>
			<td style="text-align: center;"><input type="text"
				name="detaileds|detailed[0]|loan_deadline" style="width: 80%"
				class="input_text required" maxlength=20 label="贷款期限" value="" />
			</td>
			<td style="text-align: center;"><input type="text"
				name="detaileds|detailed[0]|loan_rate" style="width: 80%;text-align: right;"
				class="input_text required" onfocus="InitInput.setNumber(this,9,2,2)" label="贷款利率" value="" />
			</td>
			<td style="text-align: center;"><input type="text"
				name="detaileds|detailed[0]|base_rate" style="width: 80%;text-align: right;"
				class="input_text required" onfocus="InitInput.setNumber(this,9,2,2)" label="同期银行基准利率" value="" />
			</td>
			<td style="text-align: center;"><input type="text"
				name="detaileds|detailed[0]|loan_principal" style="width: 80%;text-align: right;" onchange="setTotalDetailed()"
				class="input_text required" onfocus="InitInput.setNumber(this,9,4,2)" label="已还贷款本金" value="" />
			</td>
			<td style="text-align: center;"><input type="text"
				name="detaileds|detailed[0]|payable_interest" style="width: 80%;text-align: right;" onchange="setTotalDetailed()"
				class="input_text required" onfocus="InitInput.setNumber(this,9,4,2)" label="应付利息" value="" />
			</td>
			<td style="text-align: center;"><input type="text"
				name="detaileds|detailed[0]|interest_paid" style="width: 80%;text-align: right;" onchange="setTotalDetailed()"
				class="input_text required" onfocus="InitInput.setNumber(this,9,4,2)" label="实际已付利息" value="" />
			</td>
			<td style="text-align: center;"><input type="text"
				name="detaileds|detailed[0]|payable_interest_rate" style="width: 80%;text-align: right;" onchange="setTotalDetailed()"
				class="input_text required" onfocus="InitInput.setNumber(this,9,4,2)" label="按照同期基准利率应付利息" value="" />
			</td>

		</tr>


		<c:set value="0" var="index" scope="page" />
		<x:forEach select="$xmlData/data/detaileds/detailed" var="detailed">

			<c:choose>
				<c:when test="${index<10}">
					<c:set value="0" var="flag" scope="page" />
				</c:when>
				<c:otherwise>
					<c:set value="" var="flag" scope="page" />
				</c:otherwise>
			</c:choose>
			<tr>
				<td align="center"><input type="radio" class="radiobutton"
					name="selDetailed"></td>
				<td align="center"><span
					name="detaileds/detailed[${flag}${index}]@seq_no">${index+1}</span></td>
				<td style="text-align: center;"><input type="text" onchange="setTotalDetailed()"
					style="width: 80%;text-align: right;" name="detaileds/detailed[${flag}${index}]/loan_limit"
					class="input_text required" onfocus="InitInput.setNumber(this,9,4,2)" label="贷款额度"
					value="<x:out select="$detailed/loan_limit" />" /></td>

				<td style="text-align: center;"><input type="text"
					style="width: 80%" name="detaileds/detailed[${flag}${index}]/loan_ctr_no"
					class="input_text required" maxlength=50 label="贷款合同号"
					value="<x:out select="$detailed/loan_ctr_no" />" /></td>
				<td align="center" >
				    <c:set var="loan_date" scope="page"><x:out select="$detailed/loan_date" />
					</c:set> <input id="loan_date_[${flag}${index}]"
					value="${loan_date}" name="detaileds/detailed[${flag}${index}]/loan_date"
					class="required date input_text" style="width: 70px" label="贷款日期" />
				</td>
				<td style="text-align: center;"><input type="text"
					style="width: 80%"
					name="detaileds/detailed[${flag}${index}]/loan_use"
					class="input_text required" maxlength=50 label="贷款用途"
					value="<x:out select="$detailed/loan_use" />" /></td>
				<td style="text-align: center;"><input type="text"
					style="width: 80%"
					name="detaileds/detailed[${flag}${index}]/loan_deadline"
					class="input_text required" maxlength=20 label="贷款期限"
					value="<x:out select="$detailed/loan_deadline" />" /></td>
				<td style="text-align: center;"><input type="text"
					style="width: 80%;text-align: right;" name="detaileds/detailed[${flag}${index}]/loan_rate"
					class="input_text required" onfocus="InitInput.setNumber(this,9,2,2)" label="贷款利率"
					value="<x:out select="$detailed/loan_rate" />" /></td>
				<td style="text-align: center;"><input type="text"
					style="width: 80%;text-align: right;" name="detaileds/detailed[${flag}${index}]/base_rate"
					class="input_text required" onfocus="InitInput.setNumber(this,9,2,2)" label="同期银行基准利率"
					value="<x:out select="$detailed/base_rate" />" /></td>
				<td style="text-align: center;"><input type="text" onchange="setTotalDetailed()"
					style="width: 80%;text-align: right;" name="detaileds/detailed[${flag}${index}]/loan_principal"
					class="input_text required" onfocus="InitInput.setNumber(this,9,4,2)" label="已还贷款本金"
					value="<x:out select="$detailed/loan_principal" />" /></td>
				<td style="text-align: center;"><input type="text" onchange="setTotalDetailed()"
					style="width: 80%;text-align: right;" name="detaileds/detailed[${flag}${index}]/payable_interest"
					class="input_text required" onfocus="InitInput.setNumber(this,9,4,2)" label="应付利息"
					value="<x:out select="$detailed/payable_interest" />" /></td>
				<td style="text-align: center;"><input type="text" onchange="setTotalDetailed()"
					style="width: 80%;text-align: right;" name="detaileds/detailed[${flag}${index}]/interest_paid"
					class="input_text required" onfocus="InitInput.setNumber(this,9,4,2)" label="实际已付利息"
					value="<x:out select="$detailed/interest_paid" />" /></td>
				<td style="text-align: center;"><input type="text" onchange="setTotalDetailed()"
					style="width: 80%;text-align: right;" name="detaileds/detailed[${flag}${index}]/payable_interest_rate"
					class="input_text required" onfocus="InitInput.setNumber(this,9,4,2)" label="按照同期基准利率应付利息"
					value="<x:out select="$detailed/payable_interest_rate" />" /></td>
			</tr>
			<c:set value="${index+1}" var="index" scope="page" />
		</x:forEach>
		<script type="text/javascript">
			showAllDateTag("tblDetailed");
		</script>
	</tbody>
</table>
<table cellpadding="0" class="t_css" width="100%" border="0" cellpadding="0" >
<tr>
<td width="8%" align="center">合计</td>
<td width="8%"><input  name="budgets/total_loan_limit" id="total_loan_limit" label="贷款情况明细表-->贷款额度合计" type="text" style="width: 80%;text-align: right;" class="gray" disabled  value="<x:out select="$xmlData/data/budgets/total_loan_limit" />"/> </td>
<td align="center" width="9.5%">/</td>
<td align="center" width="12%">/</td>
<td align="center" width="10%">/</td>
<td align="center" width="7.5%">/</td>
<td align="center" width="7.5%">/</td>
<td align="center" width="7.5%">/</td>
<td width="7.5%"><input  name="budgets/total_loan_principal" id="total_loan_principal" label="贷款情况明细表-->已还贷款本金合计" type="text" style="width: 80%;text-align: right;" class="gray" disabled  value="<x:out select="$xmlData/data/budgets/total_loan_principal" />"/> </td>
<td width="7.5%"><input  name="budgets/total_payable_interest" id="total_payable_interest" label="贷款情况明细表-->应付利息合计" type="text" style="width: 80%;text-align: right;" class="gray" disabled  value="<x:out select="$xmlData/data/budgets/total_payable_interest" />"/> </td>
<td width="7.5%"><input  name="budgets/total_interest_paid" id="total_interest_paid" label="贷款情况明细表-->实际已付利息合计" type="text" style="width: 80%;text-align: right;" class="gray" disabled  value="<x:out select="$xmlData/data/budgets/total_interest_paid" />"/> </td>
<td width="7.5%"><input  name="budgets/total_payable_interest_rate" id="total_payable_interest_rate" label="贷款情况明细表-->按照同期基准利率应付利息合计" style="width: 80%;text-align: right;" type="text"  class="gray" disabled  value="<x:out select="$xmlData/data/budgets/total_payable_interest_rate" />"/> </td>
</tr>
</table>
<table width="98%" align="center" border="0">
	<tr style="border: 0">
		<td style="border: 0"><input class="button" name="cmdAddbefore"
			type=button value="添加"
			onclick="addNewRow('tblDetailed');showDateTag('tblDetailed');setTotalDetailed();try{topObjectFrame();}catch(e){};">
			<input class="button" name="cmdMovePrev" type=button value="上移"
			onclick="movePrev('tblDetailed','selDetailed')"> <input
			class="button" name="cmdMoveNext" type=button value="下移"
			onclick="moveNext('tblDetailed','selDetailed')"> <input
			class="button" name="cmddel" type=button value="删除"
			onclick="deleteSelectedRow('tblDetailed','条贷款情况明细');setTotalDetailed()"></td>
	</tr>
</table>
<p style="color: red;">备注：1、贷款情况明细表由不同的贷款银行，对项目企业的全部贷款情况进行分别填列，贷款银行须对企业贷款情况进行确认；</p>
<p style="color: red;">　　　2、银行帐号为单位在贷款银行开设的帐号。</p>
<br/>
<div class="t_bar">
	<span class="color_red">*</span>表2：银行贷款贴息情况表（单位：万元，保留2位小数）
</div>
<table cellpadding="0" class="t_css" width="100%" border="0" cellpadding="0" id="budgetsMsg1">
<tr>
<td align="right">单位名称：</td>
<td><input  name="budgets/org_name" id="org_name" label="银行贷款贴息情况表-->单位名称" type="text"  class="input_css  required"  maxlength="50" value="<x:out select="$xmlData/data/budgets/org_name" />"/> </td>
<td align="right">项目名称：</td>
<td><input  name="budgets/project_name" id="project_name" label="银行贷款贴息情况表-->项目名称" type="text"  class="input_css  required"  maxlength="50" value="<x:out select="$xmlData/data/budgets/project_name" />"/> </td>
</tr>
</table>
<div class="t_bar">
	<span class="color_red">*</span>银行贷款情况
</div>
<table id="tblBankLoans" cellpadding="0" class="t_css" width="100%"
	border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
	<thead>
		<tr style="border: 1px solid #B7D1E6">
			<th class="TblHead" align="center" width="4%">选择</th>
			<th class="TblHead" align="center" width="4%">序号</th>
			<th class="TblHead" align="center" width="6.25%">贷款银行名称</th>
			<th class="TblHead" align="center" width="6.25%">贷款额度</th>
			<th class="TblHead" align="center" width="6.25%">贷款合同号</th>
			<th class="TblHead" align="center" width="12%">贷款起止日期</th>
			<th class="TblHead" align="center" width="6.25%">贷款用途</th>
			<th class="TblHead" align="center" width="6.25%">贷款利率(%)</th>
			<th class="TblHead" align="center" width="6.25%">同期银行基准利率(%)</th>
			<th class="TblHead" align="center" width="6.25%">已还贷款本金</th>
			<th class="TblHead" align="center" width="6%">应付利息</th>
			<th class="TblHead" align="center" width="6%">实际已支付利息</th>
			<th class="TblHead" align="center" width="6%">按照同期基准利率应付利息</th>
			<th class="TblHead" align="center" width="6%">是否已获贷款</th>
			<th class="TblHead" align="center" width="6%">已获贷款贴息额</th>
			<th class="TblHead" align="center" width="6.25%">核准文号</th>
		</tr>
	</thead>
	<tbody id="tab">
		<tr style="display: none" align="center">
			<td align="center"><input type="radio" class="radiobutton"
				name="selBankLoans"></td>
			<td align="center"><span name="bankloans|bankloan[0]@seq_no">[index]</span>
			</td>
			<td style="text-align: center;"><input type="text" 
				name="bankloans|bankloan[0]|loan_bank_name" style="width: 80%;" maxlength="50"
				class=" required" label="贷款银行名称" value="" />
			</td>
			<td style="text-align: center;"><input type="text" onchange="setTotalBankLoans()"
				name="bankloans|bankloan[0]|loan_limit" onfocus="InitInput.setNumber(this,9,4,2)" style="width: 80%;text-align: right;"
				class=" required" label="贷款额度" value="" />
			</td>
			<td style="text-align: center;"><input type="text"
				name="bankloans|bankloan[0]|loan_ctr_no" style="width: 80%"
				class=" required" maxlength=50 label="贷款合同号" value="" /></td>
			<td align="center" ><input id="loan_start_date_[0]"
				name="bankloans|bankloan[0]|loan_start_date" label="贷款开始日期" value=""
				class=" required  date dateCompare:loan_end_date_[0]" style="width: 70px" /><br/>至<br/>
				<input id="loan_end_date_[0]"
				name="bankloans|bankloan[0]|loan_end_date" label="贷款结束日期" value=""
				class=" required  date" style="width: 70px" />
				</td>
			<td style="text-align: center;"><input type="text"
				name="bankloans|bankloan[0]|loan_use" style="width: 80%"
				class=" required" maxlength=50 label="贷款用途" value="" />
			</td>
			<td style="text-align: center;"><input type="text"
				name="bankloans|bankloan[0]|loan_rate" style="width: 80%;text-align: right;"
				class=" required" onfocus="InitInput.setNumber(this,9,2,2)" label="贷款利率" value="" />
			</td>
			<td style="text-align: center;"><input type="text"
				name="bankloans|bankloan[0]|base_rate" style="width: 80%;text-align: right;"
				class=" required" onfocus="InitInput.setNumber(this,9,2,2)" label="同期银行基准利率" value="" />
			</td>
			<td style="text-align: center;"><input type="text"
				name="bankloans|bankloan[0]|loan_principal" style="width: 80%;text-align: right;" onchange="setTotalBankLoans()"
				class=" required" onfocus="InitInput.setNumber(this,9,4,2)" label="已还贷款本金" value="" />
			</td>
			<td style="text-align: center;"><input type="text"
				name="bankloans|bankloan[0]|payable_interest" style="width: 80%;text-align: right;" onchange="setTotalBankLoans()"
				class=" required" onfocus="InitInput.setNumber(this,9,4,2)" label="应付利息" value="" />
			</td>
			<td style="text-align: center;"><input type="text"
				name="bankloans|bankloan[0]|interest_paid" style="width: 80%;text-align: right;" onchange="setTotalBankLoans()"
				class=" required" onfocus="InitInput.setNumber(this,9,4,2)" label="实际已付利息" value="" />
			</td>
			<td style="text-align: center;"><input type="text"
				name="bankloans|bankloan[0]|payable_interest_rate" style="width: 80%;text-align: right;" onchange="setTotalBankLoans()"
				class=" required" onfocus="InitInput.setNumber(this,9,4,2)" label="按照同期基准利率应付利息" value="" />
			</td>
			<td style="text-align: center;">
				<cpt:select id="loan[index]" key="boolean"  name="loan" onChange="initControlValue(this.id);" style="width:80%"></cpt:select>
		         <input type="hidden" name="bankloans|bankloan[0]|loan_value" class="required" label="是否已获贷款贴息" value=""/>
		         <input type="hidden" name="bankloans|bankloan[0]|loan_name" value=""/>
			</td>
			<td style="text-align: center;"><input type="text"
				name="bankloans|bankloan[0]|have_discount_loans" style="width: 80%;text-align: right;" onchange="setTotalBankLoans()"
				class=" required" onfocus="InitInput.setNumber(this,9,4,2)" label="已获贷款贴息额" value="" />
			</td>
			<td style="text-align: center;"><input type="text"
				name="bankloans|bankloan[0]|approval_num" style="width: 80%;" 
				class=" required" maxlength="30" label="核准文号" value="" />
			</td>

		</tr>


		<c:set value="0" var="index" scope="page" />
		<x:forEach select="$xmlData/data/bankloans/bankloan" var="bankloan">

			<c:choose>
				<c:when test="${index<10}">
					<c:set value="0" var="flag" scope="page" />
				</c:when>
				<c:otherwise>
					<c:set value="" var="flag" scope="page" />
				</c:otherwise>
			</c:choose>
			<tr align="center">
				<td align="center"><input type="radio" class="radiobutton"
					name="selBankLoans"></td>
				<td align="center"><span
					name="bankloans/bankloan[${flag}${index}]@seq_no">${index+1}</span></td>
				<td style="text-align: center;"><input type="text" 
					style="width: 80%;" name="bankloans/bankloan[${flag}${index}]/loan_bank_name"
					class=" required" maxlength="50" label="贷款银行名称"
					value="<x:out select="$bankloan/loan_bank_name" />" /></td>
				<td style="text-align: center;"><input type="text" onchange="setTotalBankLoans()"
					style="width: 80%;text-align: right;" name="bankloans/bankloan[${flag}${index}]/loan_limit"
					class=" required" onfocus="InitInput.setNumber(this,9,4,2)" label="贷款额度"
					value="<x:out select="$bankloan/loan_limit" />" /></td>

				<td style="text-align: center;"><input type="text"
					style="width: 80%" name="bankloans/bankloan[${flag}${index}]/loan_ctr_no"
					class=" required" maxlength=50 label="贷款合同号"
					value="<x:out select="$bankloan/loan_ctr_no" />" /></td>
				<td align="center" >
				    <c:set var="loan_start_date" scope="page"><x:out select="$bankloan/loan_start_date" />
					</c:set> <input id="loan_start_date_[${flag}${index}]"
					value="${loan_start_date}" name="bankloans/bankloan[${flag}${index}]/loan_start_date"
					class="required date  dateCompare:loan_end_date_[${flag}${index}]" style="width: 70px" label="贷款开始日期" />
					<br/>至<br/>
					<c:set var="loan_end_date" scope="page"><x:out select="$bankloan/loan_end_date" />
					</c:set> <input id="loan_end_date_[${flag}${index}]"
					value="${loan_end_date}" name="bankloans/bankloan[${flag}${index}]/loan_end_date"
					class="required date " style="width: 70px" label="贷款结束日期" />
				</td>
				<td style="text-align: center;"><input type="text"
					style="width: 80%"
					name="bankloans/bankloan[${flag}${index}]/loan_use"
					class=" required" maxlength=50 label="贷款用途"
					value="<x:out select="$bankloan/loan_use" />" /></td>
				<td style="text-align: center;"><input type="text"
					style="width: 80%;text-align: right;" name="bankloans/bankloan[${flag}${index}]/loan_rate"
					class=" required" onfocus="InitInput.setNumber(this,9,2,2)" label="贷款利率"
					value="<x:out select="$bankloan/loan_rate" />" /></td>
				<td style="text-align: center;"><input type="text"
					style="width: 80%;text-align: right;" name="bankloans/bankloan[${flag}${index}]/base_rate"
					class=" required" onfocus="InitInput.setNumber(this,9,2,2)" label="同期银行基准利率"
					value="<x:out select="$bankloan/base_rate" />" /></td>
				<td style="text-align: center;"><input type="text" onchange="setTotalBankLoans()"
					style="width: 80%;text-align: right;" name="bankloans/bankloan[${flag}${index}]/loan_principal"
					class=" required" onfocus="InitInput.setNumber(this,9,4,2)" label="已还贷款本金"
					value="<x:out select="$bankloan/loan_principal" />" /></td>
				<td style="text-align: center;"><input type="text" onchange="setTotalBankLoans()"
					style="width: 80%;text-align: right;" name="bankloans/bankloan[${flag}${index}]/payable_interest"
					class=" required" onfocus="InitInput.setNumber(this,9,4,2)" label="应付利息"
					value="<x:out select="$bankloan/payable_interest" />" /></td>
				<td style="text-align: center;"><input type="text" onchange="setTotalBankLoans()"
					style="width: 80%;text-align: right;" name="bankloans/bankloan[${flag}${index}]/interest_paid"
					class=" required" onfocus="InitInput.setNumber(this,9,4,2)" label="实际已付利息"
					value="<x:out select="$bankloan/interest_paid" />" /></td>
				<td style="text-align: center;"><input type="text" onchange="setTotalBankLoans()"
					style="width: 80%;text-align: right;" name="bankloans/bankloan[${flag}${index}]/payable_interest_rate"
					class=" required" onfocus="InitInput.setNumber(this,9,4,2)" label="按照同期基准利率应付利息"
					value="<x:out select="$bankloan/payable_interest_rate" />" /></td>
				<td style="text-align: center;"><c:set var="loan_value"><x:out select="$bankloan/loan_value" /></c:set>
						<cpt:select id="loan${index}" key="boolean" name="loan" onChange="initControlValue(this.id);" value="${loan_value }" style="width:80%"></cpt:select>
			            <input type="hidden" name="bankloans/bankloan[${flag}${index}]/loan_value" class="required" label="是否已获贷款贴息" value="<x:out select="$bankloan/loan_value" />"/>
			            <input type="hidden" name="bankloans/bankloan[${flag}${index}]/loan_name" value="<x:out select="$bankloan/loan_name" />"/>
				</td>
				<td style="text-align: center;"><input type="text" onchange="setTotalBankLoans()"
					style="width: 80%;text-align: right;" name="bankloans/bankloan[${flag}${index}]/have_discount_loans"
					class=" required" onfocus="InitInput.setNumber(this,9,4,2)" label="已获贷款贴息额"
					value="<x:out select="$bankloan/have_discount_loans" />" /></td>
				<td style="text-align: center;"><input type="text"  maxlength="30"
					style="width: 80%;" name="bankloans/bankloan[${flag}${index}]/approval_num"
					class=" required" label="核准文号"
					value="<x:out select="$bankloan/approval_num" />" /></td>
			</tr>
			<c:set value="${index+1}" var="index" scope="page" />
		</x:forEach>
		<script type="text/javascript">
			showAllDateTag("tblBankLoans");
		</script>
	</tbody>
</table>
<table cellpadding="0" class="t_css" width="100%" border="0" cellpadding="0" >
<tr>
<td width="14.25%" align="center">合计</td>
<td width="6.25%"><input  name="budgets/total_loan_limit1" id="total_loan_limit1" label="银行贷款情况-->贷款额度合计" type="text" style="width: 80%;text-align: right;" class="gray" disabled  value="<x:out select="$xmlData/data/budgets/total_loan_limit1" />"/> </td>
<td align="center" width="6.25%">/</td>
<td align="center" width="12%">/</td>
<td align="center" width="6.25%">/</td>
<td align="center" width="6.25%">/</td>
<td align="center" width="6.25%">/</td>
<td width="6.25%"><input  name="budgets/total_loan_principal1" id="total_loan_principal1" label="银行贷款情况-->已还贷款本金合计" type="text" style="width: 80%;text-align: right;" class="gray" disabled  value="<x:out select="$xmlData/data/budgets/total_loan_principal1" />"/> </td>
<td width="6%"><input  name="budgets/total_payable_interest1" id="total_payable_interest1" label="银行贷款情况-->应付利息合计" type="text" style="width: 80%;text-align: right;" class="gray" disabled  value="<x:out select="$xmlData/data/budgets/total_payable_interest1" />"/> </td>
<td width="6%"><input  name="budgets/total_interest_paid1" id="total_interest_paid1" label="银行贷款情况-->实际已付利息合计" type="text" style="width: 80%;text-align: right;" class="gray" disabled  value="<x:out select="$xmlData/data/budgets/total_interest_paid1" />"/> </td>
<td width="6%"><input  name="budgets/total_payable_interest_rate1" id="total_payable_interest_rate1" label="银行贷款情况-->按照同期基准利率应付利息合计" style="width: 80%;text-align: right;" type="text"  class="gray" disabled  value="<x:out select="$xmlData/data/budgets/total_payable_interest_rate1" />"/> </td>
<td align="center" width="6%">/</td>
<td width="6%"><input  name="budgets/have_discount_loans" id="have_discount_loans" label="银行贷款情况-->已获贷款贴息额" style="width: 80%;text-align: right;" type="text"  class="gray" disabled  value="<x:out select="$xmlData/data/budgets/have_discount_loans" />"/> </td>
<td align="center" width="6.25%">/</td>
</tr>
<tr>
<td colspan="3" align="right">申请贷款贴息资金：</td>
<td colspan="4"><input  name="budgets/apply_loan" id="apply_loan" style="width: 80%;text-align: right;" type="text"  class="gray" disabled  value="<x:out select="$xmlData/data/budgets/apply_loan" />"/> </td>
<td colspan="4" align="right">以前年度已获贷款贴息资金：</td>
<td colspan="3"><input  name="budgets/apply_loan_already" id="apply_loan_already" style="width: 80%;text-align: right;" type="text"  class="gray" disabled  value="<x:out select="$xmlData/data/budgets/apply_loan_already" />"/> </td>
</tr>
</table>
<table width="98%" align="center" border="0">
	<tr style="border: 0">
		<td style="border: 0"><input class="button" name="cmdAddbefore"
			type=button value="添加"
			onclick="addNewRow('tblBankLoans');showDateTag('tblBankLoans');setTotalBankLoans();try{topObjectFrame();}catch(e){};">
			<input class="button" name="cmdMovePrev" type=button value="上移"
			onclick="movePrev('tblBankLoans','selBankLoans')"> <input
			class="button" name="cmdMoveNext" type=button value="下移"
			onclick="moveNext('tblBankLoans','selBankLoans')"> <input
			class="button" name="cmddel" type=button value="删除"
			onclick="deleteSelectedRow('tblBankLoans','银行贷款情况');setTotalBankLoans()"></td>
	</tr>
</table>
<p style="color: red;">备注：1、贷款及结息情况表填列项目企业全部贷款的放贷及还本付息情况；</p>
<p style="color: red;">　　　2、项目每一笔贷款本金和应付利息全部付清后，申请贷款贴息资金。</p>

<script type="text/javascript">
function setTotalDetailed(){
	var count1=0;
	var count2=0;
	var count3=0;
	var count4=0;
	var count5=0;
	$("#tblDetailed tr:gt(1)").each(function() {
		   var fund1 = $(this).children().eq("2").children().val();
		   var fund2 = $(this).children().eq("9").children().val();
		   var fund3 = $(this).children().eq("10").children().val();
		   var fund4 = $(this).children().eq("11").children().val();
		   var fund5 = $(this).children().eq("12").children().val();
		   if (!$.isNumeric(fund1))  fund1 = "0";
		   if (!$.isNumeric(fund2)) fund2 = "0";
		   if (!$.isNumeric(fund3)) fund3 = "0";
		   if (!$.isNumeric(fund4)) fund4 = "0";
		   if (!$.isNumeric(fund5)) fund5 = "0";
		   count1=parseFloat(count1)+parseFloat(fund1);
		   count2=parseFloat(count2)+parseFloat(fund2);
		   count3=parseFloat(count3)+parseFloat(fund3);
		   count4=parseFloat(count4)+parseFloat(fund4);
		   count5=parseFloat(count5)+parseFloat(fund5);
	});
	$("#total_loan_limit").val(formatVal2(count1));
	$("#total_loan_principal").val(formatVal2(count2));
	$("#total_payable_interest").val(formatVal2(count3));
	$("#total_interest_paid").val(formatVal2(count4));
	$("#total_payable_interest_rate").val(formatVal2(count5));
}

function setTotalBankLoans(){
	var count1=0;
	var count2=0;
	var count3=0;
	var count4=0;
	var count5=0;
	var count6=0;
	var v_apply_loan =0;
	var v_apply_loan_already =0;
	
	$("#tblBankLoans tr:gt(1)").each(function() {
		
		   var fund1 = $(this).children().eq("3").children().val();
		   var fund2 = $(this).children().eq("9").children().val();
		   var fund3 = $(this).children().eq("10").children().val();
		   var fund4 = $(this).children().eq("11").children().val();
		   var fund5 = $(this).children().eq("12").children().val();
		   var fund6 = $(this).children().eq("14").children().val();
		   if (!$.isNumeric(fund1))  fund1 = "0";
		   if (!$.isNumeric(fund2)) fund2 = "0";
		   if (!$.isNumeric(fund3)) fund3 = "0";
		   if (!$.isNumeric(fund4)) fund4 = "0";
		   if (!$.isNumeric(fund5)) fund5 = "0";
		   if (!$.isNumeric(fund6)) fund6 = "0";
		   count1=parseFloat(count1)+parseFloat(fund1);
		   count2=parseFloat(count2)+parseFloat(fund2);
		   count3=parseFloat(count3)+parseFloat(fund3);
		   count4=parseFloat(count4)+parseFloat(fund4);
		   count5=parseFloat(count5)+parseFloat(fund5);
		   count6=parseFloat(count6)+parseFloat(fund6);
		   if(formatVal2(fund1) == formatVal2(fund2) && formatVal2(fund3) == formatVal2(fund4) && formatVal2(fund6) == 0){
			   v_apply_loan=parseFloat(v_apply_loan)+parseFloat(fund5);
		   }
		   if(formatVal2(fund1) == formatVal2(fund2) && formatVal2(fund3) == formatVal2(fund4)){
				v_apply_loan_already =parseFloat(v_apply_loan_already)+parseFloat(fund6);
			}
		   
	});
	$("#total_loan_limit1").val(formatVal2(count1));
	$("#total_loan_principal1").val(formatVal2(count2));
	$("#total_payable_interest1").val(formatVal2(count3));
	$("#total_interest_paid1").val(formatVal2(count4));
	$("#total_payable_interest_rate1").val(formatVal2(count5));
	$("#have_discount_loans").val(formatVal2(count6));
	$("#apply_loan_already").val(formatVal2(v_apply_loan_already));
	$("#loan_rate").val(formatVal2(v_apply_loan_already));
	$("#apply_loan").val(formatVal2(v_apply_loan));
	$("#sqje").val(formatVal2(v_apply_loan));
	
	/*
	if(formatVal2(count1) == formatVal2(count2) && formatVal2(count3) == formatVal2(count4) && formatVal2(count6) == 0){
		$("#apply_loan").val(formatVal2(count5));
	}else{
		$("#apply_loan").val("0.00");
	}
	
	if(formatVal2(count1) == formatVal2(count2) && formatVal2(count3) == formatVal2(count4)){
		$("#apply_loan_already").val(formatVal2(count6));
	}else{
		$("#apply_loan_already").val("0.00");
	}*/
}

</script>
